package com.hyperboost.backend.service.impl;

import java.util.List;
import com.hyperboost.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hyperboost.backend.mapper.ShareCommentMapper;
import com.hyperboost.backend.domain.ShareComment;
import com.hyperboost.backend.service.IShareCommentService;

/**
 * 分享评论Service业务层处理
 * 
 * @author LXY
 * @date 2025-04-19
 */
@Service
public class ShareCommentServiceImpl implements IShareCommentService 
{
    @Autowired
    private ShareCommentMapper shareCommentMapper;

    /**
     * 查询分享评论
     * 
     * @param commentId 分享评论主键
     * @return 分享评论
     */
    @Override
    public ShareComment selectShareCommentByCommentId(Long commentId)
    {
        return shareCommentMapper.selectShareCommentByCommentId(commentId);
    }

    /**
     * 查询分享评论列表
     * 
     * @param shareComment 分享评论
     * @return 分享评论
     */
    @Override
    public List<ShareComment> selectShareCommentList(ShareComment shareComment)
    {
        return shareCommentMapper.selectShareCommentList(shareComment);
    }

    /**
     * 新增分享评论
     * 
     * @param shareComment 分享评论
     * @return 结果
     */
    @Override
    public int insertShareComment(ShareComment shareComment)
    {
        shareComment.setCreateTime(DateUtils.getNowDate());
        return shareCommentMapper.insertShareComment(shareComment);
    }

    /**
     * 修改分享评论
     * 
     * @param shareComment 分享评论
     * @return 结果
     */
    @Override
    public int updateShareComment(ShareComment shareComment)
    {
        shareComment.setUpdateTime(DateUtils.getNowDate());
        return shareCommentMapper.updateShareComment(shareComment);
    }

    /**
     * 批量删除分享评论
     * 
     * @param commentIds 需要删除的分享评论主键
     * @return 结果
     */
    @Override
    public int deleteShareCommentByCommentIds(Long[] commentIds)
    {
        return shareCommentMapper.deleteShareCommentByCommentIds(commentIds);
    }

    /**
     * 删除分享评论信息
     * 
     * @param commentId 分享评论主键
     * @return 结果
     */
    @Override
    public int deleteShareCommentByCommentId(Long commentId)
    {
        return shareCommentMapper.deleteShareCommentByCommentId(commentId);
    }
}
